
<script>
export default {
  data() {
    return {
      str: '数据1'
    }
  },
  methods: {
    myClick() {
      this.str = '数据2'
    }
  }
}
</script>
<template>
  <h3>组件2</h3>
  <div>{{ str }}</div>
  <button @click="myClick">点击</button>
</template>